package com.pingpang.netty.client;

import java.util.List;

import com.pingpang.test.Test;
import com.pingpang.test.UserInfo;

public class TestClient {
 public static void main(String[] args) {
	//NettyClient nc=new NettyClient();
	//NettyClientHandler nh=new NettyClientHandler();
	//nh.setClient(nc);
	//RpcFactory<Test> f=new RpcFactory<>();
	//f.setClient(nc);
	//RpcFactoryBean<Test>rb=new RpcFactoryBean<>(Test.class,new RpcFactory<>());
	//rb.setFactory(f);
	
	RpcFactoryBean<Test>rb=new RpcFactoryBean<>(Test.class);
	Test t=rb.getRpc();
	System.out.println("结果"+t.add(1, 2));
	System.out.println("用户:"+t.findUserByName("张三", "123"));
	List<UserInfo> list=t.findUserList();
	for(UserInfo u:list) {
		System.out.println(u.toString());
	}
	System.out.println("所有用户:"+list.size());
	rb.getFactory().closeThreadPool();
 }
}